In general, networks and computers operate in different manners. Networks operate by transferring data in streams and/or packets. Streams may be bit-sized, byte-sized, or otherwise broken down. Packets may be of relatively large size, such as 64, 512, or more bytes each. Computers operate by processing data, typically in well-defined small sizes, such as bytes (8 bits), words (16 bits), double words (32 bits) and so on. At the interface between a computer and a network, a translation or reorganization of data may be necessary. This may include reorganizing data from a series of packets into a format useful to a processor. In particular, this may include taking data bits of a series of bytes and reorganizing them into a form including only data bits. A similar problem may occur at a byte-level, wherein some bytes of a group of bytes are data bytes, and other bytes are effectively control bytes which need to be parsed out of data.
The packets utilized in networks typically have one of two (control and data) forms. Control packets contain information indicating how the network is behaving or how a device within the network should behave. Data packets contain data which is being transmitted across the network. Typically, control packets and data packets are handled differently, in that control packets must be parsed to determine if the receiving system needs to change its operation, whereas data packets must be parsed to extract the transferred data. As these control and data packets are handled differently, they are often handled by different parts of a system.
FIG. 1 illustrates an embodiment of a conventional system which uses data and control packets in block diagram form. Data is received and sent on line 110, which may be a fiber optic cable for example. Coupled to line 110 is physical layer 120, which translates signals from line 110 into a form suitable for use by circuitry, such as through optoelectronic transformation. Coupled to physical layer 120 is framer 130, which operates to frame or deframe data for transmission or reception. Coupled to framer 130 is network processor 140, which may be used to process data for transmission or reception, and which receives PPP (point-to-point protocol) packets 135 from framer 130. Coupled to network processor 140 is host system 160, which may transfer data between network processor 140 and a network interface 180 which couples to an internal network. Also coupled to network processor 140 is central processor 150.
Network processor 140 separates out PPP control packets 145 from data packets in PPP packets 135, and provides PPP control packets 145 to central processor 150. Central processor 150 then provides PPP control packets to host system 160 through PPP software stack 170, which may be a software stack in memory accessible by both central processor 150 and the rest of host system 160. The data packets of PPP packets 135 are handled by network processor 140 and processed therein, with the data typically provided to host system 160.
The relevant aspects of the operations of the system of FIG. 1 are illustrated in FIG. 2. FIG. 2 illustrates an embodiment of a conventional method of handling data and control packets in flow diagram form. At block 210, a PPP packet is received. At block 220, the PPP packet is transferred from the framer (such as framer 130 for example) to the network processor (such as network processor 140 for example). At block 230, the network processor determines what type of packet it has received. If it is a control packet, the process turns to block 240, and the control packet is transferred to the host software stack (such as software stack 170 for example), for handling by the host system (such as host system 160 for example). If the packet received at block 210 is a data packet, at block 250, the data of the data packet is provided to the host system by the network processor, after processing by the network processor.
Thus, the network processor uses its resources to determine whether the packets received through a network line, and passed through a physical link layer and a framer, are either data or control packets. If half of the packets received are control packets, this means that the network processor uses its resources on a fruitless comparison on the other half of the packets received (the data packets). However, in practical terms, a well-functioning network will have many more data packets than control packets in transit at a given time, so the fruitless comparison is performed on the vast majority of the packets.